﻿using Ninject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using TimeTracker.Data;
using TimeTracker.Data.Contracts;

namespace TimeTracker.WebUI
{
    public class IocConfig
    {
        public static void RegisterIoC(HttpConfiguration config)
        {
            var kernel = new StandardKernel();

            kernel.Bind<RepositoryFactories>().To<RepositoryFactories>().InSingletonScope();

            kernel.Bind<IRepositoryProvider>().To<RepositoryProvider>();
            kernel.Bind<ITimeTrackerUow>().To<TimeTrackerUow>();

            config.DependencyResolver = new NinjectDependencyResolver(kernel);
        }
    }
}